/** COPYRIGHT(C) 2008. Loc Phan. All Rights Reserved.
    A class that display Button
    @author Loc Phan
    @version 1.01 2008-12-1
*/

package edu.sjsu.cs.phan.gui;

import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;


public class ButtonViewer
{
   public static void main(String[] args)
   {
      final int FRAME_WIDTH = 200;
      final int FRAME_HEIGHT = 100;
      
      JFrame frame = new JFrame();
      frame.setTitle("Click!");
      frame.setSize(FRAME_WIDTH, FRAME_HEIGHT);
      
      JButton button = new JButton("Click me!");
      JPanel panel = new JPanel();
      
      panel.add(button);
      frame.add(panel);
      
      ActionListener listener = new ButtonListener();
      button.addActionListener(listener);
      
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.setVisible(true);
   }
   
}
